
#ifndef _MEMBER_BHANDLER_H_
#define _MEMBER_BHANDLER_H_

#include <BHandler>
#include <BViewer>
#include <BCamera>

#define handler_member(handler)		((member_BHandler*)((BHandler*)handler)->_ptr)

namespace BWE
{
	class member_BHandler
	{
	public:
		member_BHandler(BHandler* handler);
		~member_BHandler();

		void setViewer(BViewer* newViewer);

		inline void event(const BEvent& event)
		{
			boss->event(event);
		}
		inline void paint(BPainter& painter)
		{
			boss->paint(painter);
		}
		inline void render(BRender& render)
		{
			boss->render(render);
		}

	public:
		BHandler*				boss;
		BViewer*				viewer;
		BHandler*				parent;
		BArray<BHandlerHolder>	children;
	};
}

#endif
